<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=750,user-scalable=0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>测试摇一摇</title>


    <script src="https://a.plant360.cn/static/advantech_ride/h5_img/jquery-3.6.0.min.js"></script>
    <script src="https://a.plant360.cn/static/advantech_ride/h5_img/jquery-1.11.3.min.js"></script>


    <script src="https://a.plant360.cn/static/Public/res/js/libs/vue/vue.min.js"></script>
</head>

<body>

    <div id="page">
    <div>{{x}}
    </div>
    </div>


    <script>
        new Vue({
            el: '#page',
            data: {
                SHAKE_THRESHOLD: 3000,//定义一个摇动的值
                last_update: 0,//定义一个变量保存上次更新的时间
                x: 0, //定义xyz记录三个轴的数据以及上一次出发的时间
                y: 0,
                z: 0,
                last_x: 0,
                last_y: 0,
                last_z: 0,
                count: 0,//次数

                open_tan: false,
                yaoyiyao: false,
                no_yao: false,

                ceshi_tan: false,
                is_yao: false,
            },
            methods: {
//   window.addEventListener('devicemotion', that.deviceMotionHandler, false);
fun(){
this.x++
}
            },
            mounted() {
                    window.addEventListener('devicemotion',this.fun);

            },


        })

    </script>



</body>

</html>